package com.Data;

import java.io.Serializable;
import java.util.Timer;

public abstract class Item implements CommandTimerTask, Serializable, Storable {
	private static final long serialVersionUID = -4295022188057699239L;
	
	final static public int SMILE_MAN = 1;
	final static public int NINJA = 2;
	final static public int BEAR = 3;
	final static public int LION = 4;
	final static public int SMILE_KING = 5;
	final static public int ANGRY = 6;
	final static public int CLEAR = 7;
	final static public int EXTEND = 8;
	
	protected transient Timer timer;
	protected transient ConcCommandTimerTask timerTask;
	final protected int timerPeriod = 20;
	
	protected void startTimer(){
		timer = new Timer();
		timerTask = new ConcCommandTimerTask(this);
		timer.schedule(timerTask,0,timerPeriod);
	}
	
	protected void endTimer(){
		timer.cancel();
		timer = null;
		timerTask = null;
	}
	
	public void stopTimer(){
		if(!(timer == null))
			endTimer();
	}
	
	@Override
	public void timerTask() {
	}

	public abstract void useItem(Character par, Block block);
	
	@Override
	public void setData(Storable data) {
	}

}